package kr.hkit.summary_java.service;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class TestFrame extends JFrame implements ActionListener {

	private JPanel contentPane;
	private JMenuBar menuBar;
	private String[] menuTitle;
	
	private JMenu mnDepartment;
	private JMenu mnEmployee;
	
	private JMenuItem mnbtnDeptAdd;
	private JMenuItem mnbtnDeptDel;
	private JMenuItem mnbtnDeptUp;
	private JMenuItem mnbtnDeptSearch;
	private JMenuItem mnbtnEmpAdd;
	private JMenuItem mnbtnEmpDel;
	private JMenuItem mnbtnEmpUp;
	private JMenuItem mnbtnEmpSearch;

	
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TestFrame frame = new TestFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public TestFrame() {
		initialize();
	}
	private void initialize() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		menuBar = new JMenuBar();
		contentPane.add(menuBar, BorderLayout.NORTH);
		
		//부서
		
		mnDepartment = new JMenu("부서정보");
		menuBar.add(mnDepartment);
		
		mnbtnDeptAdd = new JMenuItem("삽입");
		mnbtnDeptAdd.addActionListener(this);
		mnDepartment.add(mnbtnDeptAdd);
		
		mnbtnDeptDel = new JMenuItem("삭제");
		mnDepartment.add(mnbtnDeptDel);
		
		mnbtnDeptUp = new JMenuItem("수정");
		mnDepartment.add(mnbtnDeptUp);
		
		mnbtnDeptSearch = new JMenuItem("검색");
		mnDepartment.add(mnbtnDeptSearch);
	
		
		mnEmployee = new JMenu("사원정보");
		menuBar.add(mnEmployee);
		
		mnbtnEmpAdd = new JMenuItem("삽입");
		mnEmployee.add(mnbtnEmpAdd);
		
		mnbtnEmpDel = new JMenuItem("삭제");
		mnEmployee.add(mnbtnEmpDel);
		
		mnbtnEmpUp = new JMenuItem("수정");
		mnEmployee.add(mnbtnEmpUp);
		
		mnbtnEmpSearch = new JMenuItem("검색");
		mnEmployee.add(mnbtnEmpSearch);	
	}

	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == mnbtnDeptAdd) {
			actionPerformedMnbtnDeptAdd(e);
		}
	}
	protected void actionPerformedMnbtnDeptAdd(ActionEvent e) {
		
		
	}
}
